package com.icode.web.frontController.house;

import com.icode.core.dto.house.HomePageDTO;
import com.icode.service.house.HomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-3-4
 * Time: 上午9:19
 * To change this template use File | Settings | File Templates.
 */
@Controller("homePageFrontController")
@RequestMapping(value = "/front/home")
public class HomePageFrontController {

    @Autowired
    private HomePageService homePageService;

    @RequestMapping(value = "show", method = RequestMethod.GET)
    public ModelAndView show() {
        HomePageDTO homePageDTO = homePageService.findHomePage();
        return new ModelAndView("/front/index", "homePageDTO", homePageDTO);
    }
}
